package newhiant.hianto2o.com.model;

import android.databinding.BaseObservable;
import android.databinding.Bindable;
import android.view.View;
import android.widget.Toast;

import newhiant.hianto2o.com.BR;

/**
 * Created by Administrator on 2017/7/29 0029.
 */

public class Member extends BaseObservable {


    public String name;
    private String icon;


    public Member(String name, String icon) {
        this.name = name;
        this.icon = icon;
    }

    public void onNameClick(View view) {
        Toast.makeText(view.getContext(), name + "---is onclick", Toast.LENGTH_SHORT).show();
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }


    @Bindable
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
        notifyPropertyChanged(BR.name);
    }

    public void onItemClick(View view) {
        setName(name + "【已更新】");
    }
}
